package com.abc.demo1.controller;

import com.abc.demo1.bean.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Kar
 * @create 2022-04-12 上午9:55
 */
@Controller
public class ThymeleafTestPageController {
    @GetMapping("/thymeleaf")
    public String design(String message, ModelMap model) {
        model.put("message", message);
        model.put("num", 9999999.99);
        model.put("isHot", true);
        List<String> tmpList = new ArrayList();
        tmpList.add(message);
        tmpList.add("9999.99");
        tmpList.add("true");
        model.put("arrays", tmpList);
        User user = new User();
        user.setName("Kar");
        user.setAge(18);
        model.put("user",user);
        return "thymeleaf_test";
    }
}
